package com.smart.manager.union.mall.body;

import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.union.mall.enums.MallGoodsState;
import com.smart.manager.union.mall.views.KindView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * 帮助
 *
 * @author Leo
 * @date 2023/08/16
 */
public class RUnionMallGoods {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RUnionMallGoods1")
    public static class SearchBody extends BaseSearch {



        @ApiModelProperty("商品标题")
        private String title;



        @ApiModelProperty("所属类型")
        private String kindCode;

    }


    @Data
    @ApiModel("RUnionMallGoods2")
    public static class EditBody implements Serializable {



        @ApiModelProperty("商品标题")
        @NotBlank(message = "商品标题 不能为空")
        @Length( max = 200, message = " 商品标题长度不能超过200个字符")
        private String title;

        @ApiModelProperty("可用库存数")
        @NotNull(message = "可用库存数 不能为空")
        private Integer stockTotal;


        @ApiModelProperty("商品主图")
        @NotBlank(message = "类别名称不能为空")
        @Length( max = 500, message = "类别名称长度不能超过500个字符")
        private String picture;

        @ApiModelProperty("商品详情")
        @Length( max = 50, message = "类别名称长度不能超过50个字符")
        private String detail;

        @ApiModelProperty("标准售价")
        @NotNull(message = "标准售价 不能为空")
        private Integer stdPrice;


        @ApiModelProperty("折扣售价")
        @NotNull(message = "折扣售价 不能为空")
        private Integer disPrice;


        @ApiModelProperty("所属类型")
        @NotNull(message = "所属类型 不能为空")
        private KindView kind;

        @ApiModelProperty("商品状态")
        @NotNull(message = "商品状态 不能为空")
        private MallGoodsState state;
    }


}
